package com.example.gateway.designPattern.decorator;

import com.example.gateway.designPattern.decorator.Drink;

/**
 * @ClassName: Decorator
 * @Description:
 * @Author: YourName
 * @Date: 2024/12/31
 */

public abstract class Decorator extends com.example.gateway.designPattern.decorator.Drink {

    protected com.example.gateway.designPattern.decorator.Drink drink;

    public Decorator(Drink drink) {
        this.drink = drink;
    }

    @Override
    public float cost() {
        // TODO Auto-generated method stub
        return super.getPrice() + drink.cost();
    }
    @Override
    public String getDescription() {
        return super.description + "-" + super.getPrice() + "&&" + drink.getDescription();
    }
}
